package com.hb.C_Lambda表达式和集合.D_集合.list_map

import java.util.*

class Demo01 {
}


/**
 * 什么是map
 * map类似一个词典，词典有索引，索引对应了具体的内容
 */

fun main() {
    val lists = listOf("aa", "bb", "cc")
    for (list in lists) {
        println(list)
    }

    for ((i,e) in lists.withIndex()) {
        println("$i --> $e")
    }

    //声明一个map
    val map = TreeMap<String, String>()
    map["好"]="goods"
    map["学习"]="study"

    //获取值
    println(map["好"])

}